
<?php
  require_once('nav.php');
  require_once('inc_admin.php');
  //连接数据库   
  connect();
  $name=$_GET['search'];
  $sql="select * from flower where zb_title like '%{$name}%' ";
  $result=mysql_query($sql)or die('filed'.mysql_error());
  $flower=fetch_array($result);
  if(!$result){
    echo "无数据！<br/>";
    echo "<a href='flowerlist.php'>返回</a>";   
  }else{    
  echo "查询成功！";
 ?>
 <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
         <div class="table-responsive">
          <h1 class="page-header">查询结果</h1>
            <table class="table table-striped table-hover">
            <thead>
                <tr>
                  <th>序号</th>
                  <th>鲜花标题</th>
                  <th>产地</th>
                  <th>简介</th>
                  <th>添加鲜花时间</th>
                  <th>操作</th>
                </tr>
              </thead>
            <tbody>
  <?php
  foreach ($flower as $index=>$one) {
                              echo '<tr>';
                              echo '<td>'.($index+1).'</td>';
                              echo "<td><a href='detail.php?id=".$one['zb_id']."'>".$one['zb_title']."</a> ";
                              //echo '<td>'.$one['zb_title'].'</td>';
                              echo '<td>'.$one['zb_place'].'</td>';
                              echo '<td>'.$one['zb_adddate'].'</td>';
                              echo '<td>'.$one['zb_hint'].'</td>';
                              echo "<td><a class='btn btn-default' href='editorder.php?id=".$one['zb_id']."' role='button'>修改</a>";
                              echo '<a class="btn btn-default" href="delflower.php?id='.$one['zb_id'].'" onClick="return confirm(\'确定要删除吗？\');" role="button">删除</a></td>';
                              echo "</tr>";
                    }
                    $totalrows = count($flower);
                    echo "<table align='center'><tr><td>共有{$totalrows}个订单</td></tr></table>";   
  }    
  ?>
  </tbody>
            </table>
            </div>
        </div>
  <?php  
  require_once("footer.php")
?>
